package tv.dyndns.kishibe.client.packet;

import java.util.Collection;
import java.util.List;

import name.pehl.piriti.json.client.JsonReader;

import com.google.common.collect.ImmutableList;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.IsSerializable;

public class PacketChatDataList implements IsSerializable {
	public static class Json {
		public interface PacketChatDataListReader extends JsonReader<PacketChatDataList> {
		}

		public static final PacketChatDataListReader READER = GWT
				.create(PacketChatDataListReader.class);
	}

	public List<PacketChatData> list;

	public static PacketChatDataList fromChatData(PacketChatData chatData) {
		PacketChatDataList list = new PacketChatDataList();
		list.list = ImmutableList.of(chatData);
		return list;
	}

	public static PacketChatDataList fromChatData(Collection<PacketChatData> chatData) {
		PacketChatDataList list = new PacketChatDataList();
		list.list = ImmutableList.copyOf(chatData);
		return list;
	}
}
